<template>
	<div v-if="Object.keys(goods).length !== 0" class="base-info">
		<div class="base-title">
			<h4>{{goods.title}}</h4>
		</div>
		<div class="base-price">
			<span class="n-price">{{goods.newPrice}}</span>
			<span class="o-price">{{goods.oldPrice}}</span>
			<span class="discount" v-if="goods.discount">{{goods.discount}}</span>
		</div>
		<div class="bottom-info">
			<span>{{goods.columns[0]}}</span>
			<span>{{goods.columns[1]}}</span>
			<span>{{goods.services[goods.services.length-1].name}}</span>
		</div>
		<div class="services">
			<span v-for="index in goods.services.length-1" :key='index'>
			<img :src="goods.services[index-1].icon" >
			{{goods.services[index-1].name}}
			</span>
		</div>
	</div>
</template>

<script>
	export default {
		name:'detailBaseInfo',
		props:{
			goods:Object
		}
	}
</script>

<style scoped>
	.base-info {
	}
	.base-title {
		margin:15px 8px 15px 8px
	}
	.base-title h4 {
		text-indent: 20px;
	}
	.base-price {
		position: relative;
		margin-left: 7px;
	}
	.base-price .n-price {
		font-size: 30px;
		color:var(--color-high-text)
	}
	.base-price .o-price {
		padding-left: 10px;
		padding-right:10px ;
		text-decoration: line-through;
		font-size: 12px;
		color:darkgrey;
	}
	.base-price .discount {
		background-color: var(--color-high-text);
		color: white;
		border-radius: 10px;
		padding: 4px;
		position: absolute;
		top: -2px;
	}
	.bottom-info {
		margin: 20px 7px 0 7px;
		padding-bottom: 10px;
		display: flex;
		justify-content:space-between;
		font-size: 15px;
		border-bottom: 1px solid rgba(100,100,100,.1);
	}
	.services {
		padding: 0 7px 0 7px;
		line-height: 60px;
		display: flex;
		justify-content:space-between;
		font-size: 13px;
		color: #333;
		border-bottom: 5px solid #f2f5f8;
	}
	.services img {
		width: 14px;
		height: 14px;
		position: relative;
		top: 2px;
	}
</style>
